const express = require("express");
//导入映射函数
const {login, regUser} = require("../router-handler/user");

//创建router实例
const router = express.Router();
//导入校验规则的包
const expressJoi = require("@escook/express-joi");
//导入需要验证规则
const {reg_login_schema} = require("../schema/user")


//定义用户注册接口
router.post("/register", expressJoi(reg_login_schema), regUser)

//定义用户登录接口
router.post('/login', expressJoi(reg_login_schema), login)

//导出路由
module.exports = router;
